package com.ly.service.user;

import com.ly.ApplicationTests;
import com.ly.service.IUserService;
import com.ly.service.ServiceMultiResult;
import com.ly.web.dto.UserDTO;
import com.ly.web.form.DatatableUserSearch;
import com.ly.web.form.RentSearch;
import org.junit.Assert;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @author ：LY
 * @date ：Created in 2021/8/16 16:56
 * @modified By：
 */
public class UserService extends ApplicationTests {

    @Autowired
    IUserService userService;
    @Test
    public void testQuery(){
        DatatableUserSearch datatableUserSearch = new DatatableUserSearch();
        datatableUserSearch.setDirection("desc");
        datatableUserSearch.setOrderBy("createTime");
        datatableUserSearch.setDraw(1);
        datatableUserSearch.setStart(0);
        datatableUserSearch.setLength(3);

        ServiceMultiResult<UserDTO> userDTOServiceMultiResult = userService.adminUserQuery(datatableUserSearch);

        Assert.assertEquals(2,userDTOServiceMultiResult.getTotal());

    }
}
